package com.example.common.base;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;

import com.example.common.R;

/**
 * @author skygge
 * @date 2020-01-02.
 * GitHub：javofxu@github.com
 * email：skygge@yeah.net
 * description：
 */
public class BaseLoadingDialog extends Dialog {

    public BaseLoadingDialog(Context context) {
        super(context, R.style.window_background);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_loading_view);
        setCanceledOnTouchOutside(false);
        Window window = getWindow();
        assert window != null;
        //dialog显示位置，不设置默认居中
        window.setGravity(Gravity.CENTER);
    }
}
